package jeni2.VCD;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;

public class inputpeminjaman extends Activity{
	private Button simpan,ceksewa;
	private EditText nama,alamat,nohp;
	private Spinner nocd;
	private buatdatabase dbhelper;
	private String isi;
	String [] coba = {};
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);		
		dbhelper = new buatdatabase(this);
		dbhelper.open();
		setContentView(R.layout.inputpeminjaman);
		nocd = (Spinner) findViewById(R.id.nocd);
		nama = (EditText) findViewById(R.id.namape);
		ArrayAdapter <String> adapter = new ArrayAdapter <String> (this,android.R.layout.simple_spinner_item,coba);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        nocd.setAdapter(adapter);
		Cursor cursor = dbhelper.fetchAllAddress();
		cursor.moveToFirst();
		while (cursor.isAfterLast() == false) {
			nama.setText(cursor.getString(1));
		}
		cursor.close();
	}
	@Override
	protected void onDestroy() {
		dbhelper.close();
		super.onDestroy();
	}
}
